package com.songlanyun.modules.singlegoods.dao;

import com.songlanyun.modules.singlegoods.entity.ProductSingleGoodsEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.songlanyun.modules.skus.entity.ProductSkusEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 商家的单品表，用来管理库存
 * 
 * @author lubo
 * @email sunlightcs@gmail.com
 * @date 2020-11-04 09:03:01
 */
@Mapper
public interface ProductSingleGoodsDao extends BaseMapper<ProductSingleGoodsEntity> {
    ProductSingleGoodsEntity loadByShopIdAndId(@Param("shop_id") Long shopId, @Param("id") Long id);
    void setAbleStock(@Param("id") Long id,@Param("able_stock") int ableStock);

    Integer rarelyGoodsNum(@Param("shopId")Long shopId, @Param("num")Integer num);

    ProductSingleGoodsEntity loadByIdForLock(@Param("shop_id") Long shopId,@Param("id") Long id);
}
